﻿// --------------------------------
// <copyright file="ContentPathEditor.cs" company="Faculty of Information Technology, Czech Technical University in Prague">
//     This document is shared by Microsoft Public License (MS-PL)
//     For further details please see http://msdn.microsoft.com/en-us/library/ff648068.aspx or license.txt.
// </copyright>
// <author>Lukáš Molnár</author>

// <email>molnaluk@fit.cvut.cz</email>

// <date>14. 11. 2011 22:59:41</date>

// <summary>
//
// </summary>
// --------------------------------

#if WINDOWS

namespace FITClub.Episode1.Levels
{
    /// <summary>
    /// UI Property Grig Editor for Content Path
    /// </summary>
    //class ContentPathEditor : UITypeEditor
    //{
    //    public override UITypeEditorEditStyle GetEditStyle(ITypeDescriptorContext context)
    //    {
    //        return UITypeEditorEditStyle.Modal;
    //    }

    //    public override object EditValue(ITypeDescriptorContext context, System.IServiceProvider provider, object value)
    //    {
    //        IWindowsFormsEditorService svc = provider.GetService(typeof(IWindowsFormsEditorService)) as IWindowsFormsEditorService;
    //        if (svc != null && context.PropertyDescriptor.PropertyType == typeof(string))
    //        {
    //            using (OpenFileDialog ofd = new OpenFileDialog())
    //            {
    //                ofd.Title = "Select content file";
    //                ofd.InitialDirectory = Path.GetFullPath("Content");

    //                if (ofd.ShowDialog() == DialogResult.OK)
    //                {
    //                    return ofd.FileName.Replace(ofd.InitialDirectory, "").Remove(0, 1).Replace(".xnb", "");
    //                }
    //            }
    //        }
    //        return value;
    //    }
    //}
}

#endif